import java.util.Arrays;
import java.util.Scanner;

public class ACM_A{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] a = new int[3];
        for (int o = 0; o < num; o++) {
            a[0] = sc.nextInt();
            a[1] = sc.nextInt();
            a[2] = sc.nextInt();
            Arrays.sort(a);
            if (a[2]==a[1]&&a[0]<a[1])
                System.out.println(1);
            if (a[1]==a[2]&&a[2]==a[0])
                System.out.println(2);

        }


    }
}
